def add(a,b,*c):
    '''把所有输入的参数值做累加，并返回'''
    sum=0
    for i in c:
        sum=sum+int(i)
    sum=a+b+sum
    return sum


print(add(1,2,3,4,5))

import string
def letter_nums(*s):
    '''可变参数是字符串，统计所有字母的个数'''
    num=[]
    for i in s:
        if not isinstance(i,str):
            return None
        else:
            for j in i:
                if j in set(string.ascii_letters):
                    num.append(j)
    nums=len(num)
    return nums

print(letter_nums("ab","eaf","defke","234ddd"))

def add(**kw):
    '''把可变参数的value值进行累加，**kw代表字典'''
    sum=0
    for k ,v in kw.items():
        sum=sum+v
    return sum

print(add(a=1,b=2,c=9))

x=lambda y:y*8*8
print(x(3))

list_a=[lambda  a:a**3,lambda b:b**3]
print(list_a[0])
g=list_a[0]
print(g(3))

import string
def get_num(s):
        if s in  string.digits:
            return  int(s)
        else:
            return s
print(list(map(get_num,"abc123")))
#map()，自动循环遍历字符串中的每个字符



def func(p):
    if p in string.ascii_letters:
        return True
    else:
        return False
print(list(filter(func,"233abdgAEWD")))
